<%@page import="com.beans.AdminInfo"%>
<%@page import="com.dao.MenuDao"%>
<%@page import="com.beans.MenuInfo"%>
<%@page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath(); 
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>"> 
<meta charset="UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">  
<title>Insert title here</title>

<link rel="stylesheet" type="text/css" href="css/menu.css">

<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
<script type="text/javascript" src="js/jquery.easing.js"></script>
<script type="text/javascript" src="js/jquery.accordion.js"></script>		
<script type="text/javascript">
$(function(){
	$('#navigation').accordion({
		active:0,   /* 第一个被激活 */
		header: '.head',
		/*navigation1: false,  */
		event: 'click',
		fillSpace: true,
		animated: 'bounceslide'   /*slide,bounceslide ,bounceslide,easeslide'*/
	});
});
</script>
</head>
<body>
<!-- 一级menu菜单 -->
<%  AdminInfo admin=(AdminInfo)	session.getAttribute("session_admin");
	List<MenuInfo> menuLists=new MenuDao().getMenuLists(admin.getRoleId()); 
	request.setAttribute("menuLists",menuLists);%>
<ul id="navigation">
<c:forEach items="${menuLists}" var="one_menu">
	<li>
		<a class="head">${one_menu.getMenuName() }</a>
		<ul>
		<!-- 二级menu菜单 -->
			<c:forEach items="${one_menu.getTwoMenuInfos()}" var="menu_2">
				<li>
					<a href="${menu_2.getUrl()}" target="${menu_2.getTarget()}"><img src="images/${menu_2.getIcon()}" /><label>${menu_2.getMenuName()}</label></a>
				</li>
			</c:forEach>
		</ul>
	</li>
</c:forEach>

</ul>
</body>
</html>